<template>
	<view class="">
		<u-popup v-model="showSort" mode="center" width="650" :mask-close-able="false" :closeable="true"
			close-icon-color="#000" border-radius="15">
			<view class="sort_popup_box">
				<view class="sort_title">
					排序修改
				</view>
				<view class="">
					<u-input v-model="sortValue" :border="true" type="number" :clearable="false" placeholder=""
						placeholder-style="font-family: all-font;" />
				</view>

				<view class="sort_btn_box">
					<view class="sort_cancel_btn" @click="handleCancelSort">
						关闭
					</view>

					<view class="sort_sure_btn" @click="handleSureSort">
						确定
					</view>
				</view>
			</view>
		</u-popup>
	</view>
</template>

<script>
	export default {
		props: ['packageSortNum'],
		data() {
			return {
				showSort: false,
				sortValue: '',
				packageSortNumNew: {}
			}
		},
		watch: {
			packageSortNum: {
				handler(newVal) {
					this.sortValue = newVal.weight
				}
			}
		},
		methods: {
			// 确定
			handleSureSort() {
				this.$emit('handleSureSort', this.sortValue)
			},

			// 取消
			handleCancelSort() {
				this.$emit('handleCancelSort', '')
			},
		}
	}
</script>

<style lang="scss" scoped>
	.sort_popup_box {
		padding: 60rpx 20rpx 40rpx;
		font-family: all-font;

		.sort_title {
			text-align: center;
			font-size: 30rpx;
			font-weight: 550;
			padding-bottom: 30rpx;
		}

		.sort_btn_box {
			display: flex;
			padding-top: 60rpx;

			.sort_cancel_btn {
				display: flex;
				justify-content: center;
				align-items: center;
				width: 50%;
				height: 78rpx;
				background: #F2F2F2;
				border-radius: 39rpx 0px 0px 39rpx;
				font-weight: 500;
				font-size: 32rpx;
				color: #808080;
			}

			.sort_sure_btn {
				display: flex;
				justify-content: center;
				align-items: center;
				width: 50%;
				height: 78rpx;
				background: #308BFB;
				border-radius: 0px 39rpx 39rpx 0px;
				font-weight: 500;
				font-size: 32rpx;
				color: #FFFFFF;
			}
		}
	}
</style>